package com.ccx.coachsite.ui.own;
import android.content.Context;
import android.widget.TextView;

import com.ccx.coachsite.R;
import com.ccx.coachsite.bus.MessageInfo;
import com.ccx.coachsite.util.StringUtil;

public class OwerMessageDetailView extends OwerBaseView {
	
	private MessageInfo mMessageInfo;
	
	public OwerMessageDetailView(Context context, OwerMainBase superView, MessageInfo minfo) {
		super(context, superView);
		mMessageInfo = minfo;
		if(StringUtil.isEmpty(mMessageInfo.getContent()))
		{
			loadData();
		}
		else
		{
			doRefreshDataSuccess();
		}
	}
	
	protected boolean onLoadData() 
	{
		return OwerProvider.getInstance().getMessageDetail(mContext, mMessageInfo);	
	}
	
	protected void doRefreshDataSuccess()
	{
		TextView mTitle = (TextView)findViewById(R.id.ower_message_detail_title);
		TextView mCreator = (TextView) findViewById(R.id.ower_message_detail_create);
		TextView mTime = (TextView) findViewById(R.id.ower_message_detail_time);

		mTitle.setText(mMessageInfo.getContent());
		mCreator.setText(mMessageInfo.getCreator());
		mTime.setText(mMessageInfo.getTimes());
	}
}
